package com.thoughtworks.jspecsupport;

import org.junit.Test;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;


public class JSpecTestFilePickerTest {

    @Test
    public void js_libs_are_not_test_file() {
        JSpecTestFilePicker picker = new JSpecTestFilePicker();
        assertFalse(picker.isMatch("source", "jquery.js"));
        assertFalse(picker.isMatch("source", "jquery-1.3.2.min.js"));
        assertFalse(picker.isMatch("source", "jspec.js"));
        assertFalse(picker.isMatch("source", "env.rhino.js"));
    }

    @Test
    public void only_files_constain_assertion_are_jsepc_file() {
        JSpecTestFilePicker picker = new JSpecTestFilePicker();
        assertTrue(picker.isMatch("JSpec.describe  should.be  ", "spec.day.js"));
        assertFalse(picker.isMatch("JSpec.describe ", "spec.day.js"));
        assertFalse(picker.isMatch(" should.be  ", "spec.day.js"));

    }
}
